﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
namespace WPFExcelReport
{
    public partial class UIBF : ViewBase
    { 
        public VBSFARB TMV
        {
            get
            {
                return (VBSFARB)MV;
            }
        }
        #region ==WTKEY===========
        public static readonly DependencyProperty WTKEYProperty = DependencyProperty.Register("WTKEY",
        typeof(string), typeof(UIBF),
        new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWTKEYChanged));
        public string WTKEY
        {
            get
            {
                return (string)GetValue(WTKEYProperty);
            }
            set
            {
                SetValue(WTKEYProperty, value);
                OnWTKEYChg();
            }
        }
        private static void OnWTKEYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIBF;
            if (src != null)
            {
                src.WTKEY = (string)e.NewValue;
            }
        }
        public virtual void OnWTKEYChg()
        { }
        #endregion
        public UIBF()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
        } 
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);

            if (dwMaster == null)
            {
                KEY = "";
            }
            else
            {
                KEY = "B"+TMV.BSFKART + TMV.BSFKVAR + TMV.BSFKFARBE;
            }
        }
      
    }
}
